<?php
	include("config.php");
	include("cookie.php");
	$username = substr($user, 0, strrpos($user,"|"));
?>
<?php
$name = $_REQUEST['name'];
$dbLink	= mysql_connect ($sServer, $sUserName, $sPassword) or die("数据库Connect错误");
mysql_select_db ($sDBname, $dbLink) or die("数据库Select错误");

$sSQL = "SELECT * FROM friends where name='$name' and username='$username'";
$result = mysql_query($sSQL, $dbLink) or die("数据库Query错误");
$rows = mysql_num_rows($result);
if ($rows > 0)
{
	echo "<table border=1>\n";
	echo "<tr><td>Name</td><td>Telephone</td><td>ICQ</td><td>Address</td><td>操作</td></tr>\n";
	while ($row = mysql_fetch_assoc($result))
	{
		$name = $row['name'];
		$telephone = $row['telephone'];
		$icq = $row['icq'];
		$address = $row['address'];
		echo "<tr><td>$name</td><td>$telephone</td><td>$icq</td><td>$address</td><td><a href='edit.php?name=$name&phone=$telephone&icq=$icq&address=$address'>修改</a> <a href='delete.php?name=$name'>删除</a></td></tr>\n";
	}
	echo "</table>\n";
}
else
{
	echo "无结果!<br>";
}
mysql_close ($dbLink);
?>

